home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / ts-chap.tip < prev    next >
Text File  |  1993-09-15  |  2KB  |  64 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 31.2.7, p. III-600.
  16. % Original source in file "pp2.TEX", starting line 717.
  17. \wlog{L: "ts-chap.tip" ["pp2.TEX," l. 717, p. III-600]}%
  18. % This file DOES belong to format "texip."
  19. \InputD{counters.tip}
  20. \InputD{dblarg.tip}
  21. \InputD{ts-chhe.tip}
  22. \InputD{npright.tip}
  23. \catcode`\@ = 11
  24. \NewCounter{ChapterNo}{\arabic}% 
  25.     {\TheCounter{ChapterNo}}{\TheCounter{ChapterNo}}
  26. \def\Chapter{\DblArg{\@Chapter}}%
  27. \def\@Chapter [#1]#2{% 
  28.     \ShouldBeRightHandPage
  29.     \StepCounter{ChapterNo}%
  30.     \gdef\@LeftRunningHead{#2}%
  31.     \SetPageLayout{4}
  32.     \ChapterHeadingTeXIP{\PrintCounter{ChapterNo}}{#2}
  33.     \WriteToAuxSpecial{toc}{1}% 
  34.         {\PrintCounter{ChapterNo}}{#1}{\PrintCounter{PageNo}}%
  35.     \WriteToAuxSpecial{lof}{0}{}{}{}%
  36.     \WriteToAuxSpecial{lot}{0}{}{}{}%
  37.     \def\Label ##1{\@Label{##1}{\RefCounter{ChapterNo}}{1}}%
  38. }
  39. \NewCounter{AppendixNo}{\Alph}% 
  40.     {\TheCounter{AppendixNo}}{\TheCounter{AppendixNo}}
  41. \AddCounterToResetList{SectionNo}{AppendixNo}
  42. \AddCounterToResetList{AppendixNo}{VolumeNo}
  43. \def\Appendix{\DblArg{\@Appendix}}%
  44. \def\@Appendix [#1]#2{% 
  45.     \NewPageRightHand
  46.     \StepCounter{AppendixNo}%
  47.     \ReassignCounter{SectionNo}{\arabic}% 
  48.         {\PrintCounter{AppendixNo}.\TheCounter{SectionNo}}% 
  49.         {\PrintCounter{AppendixNo}.\TheCounter{SectionNo}}%
  50.     \SetPageLayout{4}
  51.     \ChapterHeadingTeXIP{Appendix \PrintCounter{AppendixNo}}{#2}
  52.     \WriteToAuxSpecial{toc}{1}% 
  53.         {\PrintCounter{AppendixNo}}{#1}{\PrintCounter{PageNo}}%
  54.     \def\Label ##1{\@Label{##1}{\RefCounter{AppendixNo}}{1}}%
  55.     \ignorespaces
  56. }
  57. \def\DoneWithAppendices{%
  58.     \ReassignCounter{SectionNo}{\alph}%
  59.         {\TheCounter{ChapterNo}.\TheCounter{SectionNo}}% 
  60.         {\TheCounter{ChapterNo}.\TheCounter{SectionNo}}
  61.     \def\Label ##1{\@Label{##1}{\RefCounter{ChapterNo}}{1}}%
  62. }
  63. \catcode`\@ = 12
  64.